<?php

/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/6/20
 * Time: 下午1:51
 */
namespace app\index\utils;
use app\index\model\ResultVo;

class ResultUtil
{
    public static function success($obj){
        $resultVo = new ResultVo();
        $resultVo->ret = 0;
        $resultVo->res_info = "ok";
        $resultVo->data = $obj;
        return json($resultVo);
    }
    public static function error($code,$msg){
        $resultVo = new ResultVo();
        $resultVo->ret = $code;
        $resultVo->res_info = $msg;
        return json($resultVo);
    }

}